package com.cl.pattern.flyweight;

public abstract class Flyweight {

    /**
     * 内部状态
     */
    public String intrinsic;
    /**
     * 外部状态
     */
    protected final String extrinsic;

    /**
     * 要求享元角色必须接受外部状态
     * @param extrinsic
     */

    public Flyweight(String extrinsic) {
        this.extrinsic = extrinsic;
    }

    /**
     *  定义业务操作
     * @param extrinsic
     */

    public abstract void operate(int extrinsic);

    public String getIntrinsic() {
        return intrinsic;
    }

    public void setIntrinsic(String intrinsic) {
        this.intrinsic = intrinsic;
    }

}